import { stringify } from 'qs';
import {request} from '../utils/request';
import { getConfig } from '../../config';
const config = getConfig();


// 通知、公告列表--------------------------------------------------------------------
export async function queryNoticeList(params) {
  return request('/sys/noticeinfo/list', {
    method: 'POST',
    body: params,
  });
}

// 添加通知、公告
export async function actionNoticeAdd(params) {
  return request('/sys/noticeinfo/save', {
    method: 'POST',
    body: params,
  });
}

// 编辑通知、公告
export async function actionNoticeEdit(params) {
  return request('/sys/noticeinfo/update', {
    method: 'POST',
    body: params,
  });
}


// 详情
export async function queryNoticeInfo(params) {
  if (config.isMock) {
    return request(`/sys/noticeinfo/info`, {
      method: 'POST',
      body: params,
    });
  }else{
    return request(`/sys/noticeinfo/info/${params.noticeId}`, {
      method: 'POST',
    });
  }
}


// 删除
export async function actionNoticeDel(params) {
  return request('/sys/noticeinfo/delete', {
    method: 'POST',
    body: params,
  });
}



